

import 'package:floor/floor.dart';

import '../entity/CustomerBillAttr.dart';

@dao
abstract class CustomerBillAttrDao {

  @Query('DELETE FROM CustomerBillAttr')
  Future<void> deleteAll();

  @delete
  Future<int> deleteList(List<CustomerBillAttr> beanList);

  @delete
  Future<void> deleteOne(CustomerBillAttr bean);

  @Query('SELECT * FROM CustomerBillAttr')
  Future<List<CustomerBillAttr>> findAll();

  @Query('SELECT * FROM CustomerBillAttr WHERE productCode = :productCode')
  Future<List<CustomerBillAttr>> findByProductCode(String productCode);

  @Query('SELECT * FROM CustomerBillAttr WHERE productId = :productId')
  Future<List<CustomerBillAttr>> findByProductId(int productId);

  @Query('SELECT * FROM CustomerBillAttr WHERE billId = :billId')
  Future<List<CustomerBillAttr>> findByBillId(int billId);

  @Query('SELECT * FROM CustomerBillAttr WHERE id = :id')
  Future<CustomerBillAttr?> findById(int id);

  @insert
  Future<int> insertOne(CustomerBillAttr person);

  @insert
  Future<void> insertList(List<CustomerBillAttr> personList);
}